<template>
<div id="doublePub">
         <!--后退-->
        <img class="back" src="../../assets/homepage/back.png" alt="" onclick="history.go(-1)">
        <div class="card">
              <section>
                <img src="../../assets/tabber/write.png" alt="">
                <p>
                  <textarea v-model="doublePubData.taskExplain" maxlength="294" placeholder="请输入你的任务时间及任务内容" style=""type="text"></textarea>
                      </p>
              </section>
              <section>
                <img src="../../assets/task/map.png" alt="">
                <p>
                  <input v-model="doublePubData.taskLocation" placeholder="请输入替身任务地点" style="padding:0.4rem;
                      height:2rem;width:100%;background:#f8f8f8;border-radius:4px;margin-left:0.75rem;margin-top:0.25rem;"type="text">
                      </p>
              </section>
              <section>
                <img src="../../assets/tabber/Gmoney.png" alt="">
                <p>
                  <input maxlength="4" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" v-model="doublePubData.amount" placeholder="请输入赏金金额" style="padding:0.4rem;
                      height:2rem;width:100%;background:#f8f8f8;border-radius:4px;margin-left:0.75rem;margin-top:0.25rem;"type="text">
                      </p>
              </section>
        </div>

        <div class="GenderSelection">
            <p>配送人员性别要求</p>
            <p class="genders">
              <el-radio v-model="radio" label="1"><img src="../../assets/homepage/un.png" alt=""></el-radio>
              <el-radio v-model="radio" label="2"><img src="../../assets/homepage/gril.png" alt=""></el-radio>
              <el-radio v-model="radio" label="3"><img src="../../assets/homepage/boy.png" alt=""></el-radio>
            </p>
            <div class="submit" @click="adddoublePubTask">确定</div>
        </div>
</div>
</template>
<script>
export default {
  data () {
    return {
      doublePubData:{
           amount:undefined,
           taskName:undefined,
           taskExplain:undefined,
           taskType:undefined,
           taskLocation:undefined,
      },
      paramsId:undefined,
      radio:"1",
    }
  },
  created(){
      this.paramsId = this.$route.params.id;
  },
  mounted(){
  },
  methods:{
       adddoublePubTask(){
        if(this.radio=='1'){
             this.doublePubData.allSum = '1'
        }
        if(this.radio=='2'){
             this.doublePubData.womanSum = '1'
        }
        if(this.radio=='3'){
             this.doublePubData.manSum = '1'
        }
        if(this.paramsId==2){
            this.doublePubData.taskName = '替身任务'
             this.doublePubData.taskType = '2'
        }
        if(this.paramsId==1){
            this.doublePubData.taskName = '其他任务'
            this.doublePubData.taskType = '1'
        }
         this.$router.push({
            path: '/douPubCom',
            name: 'douPubCom', 
            query: {
                name: 'douPubCom',
                data:this.doublePubData,
            }
        })
       
      },
  }
}
</script>
</script>
<style>
#doublePub{
    height:100%;
    width:100%;
    background-size:100% 100%;
    background-image:url(../../assets/tabber/bg.png);
}
#doublePub .back{
    height:0.8rem;
    width:0.5rem;
    margin-top:1.25rem;
    margin-left:1.25rem;
} 
#doublePub #card{
    padding:1rem 1.5rem;
    height:70%;width:100%;
}
#doublePub .card section:nth-child(1){
    width:80%;
    display:flex;
    height:7rem;
    background:#FFF;
    border-radius:8px;
    margin:0.75rem auto;
    box-shadow:0.1rem 0.1rem 0.5rem 0.15rem #e2e2e2;
    padding:0.6rem 0.8rem;
}
#doublePub .card section:nth-child(n+2){
    width:80%;
    display:flex;
    height:3.5rem;
    background:#FFF;
    border-radius:8px;
    margin:0.75rem auto;
    box-shadow:0.1rem 0.1rem 0.5rem 0.15rem #e2e2e2;
    padding:0.6rem 0.8rem;
}
#doublePub .card img{
    height:1.75rem;
    width:1.75rem;
    margin-top:0.5rem;
}
#doublePub .card p{
    width:80%;
    font-size:0.9rem;
    color:#888888;
}
#doublePub .card textarea{
    padding:0.4rem;
    height:5rem;
    width:100%;
    background:#f8f8f8;
    border-radius:4px;
    margin-left:0.75rem;
    margin-top:0.35rem;
}
#doublePub .GenderSelection{
    height:8rem;
    width:80%;
    margin:10rem auto 0rem;
    box-shadow:0.1rem 0.1rem 0.5rem 0.15rem #e2e2e2;
    border-radius:13px;
}
#doublePub .GenderSelection .genders{
    display:flex;
    justify-content:space-between;
    margin-top:0.25rem;
    padding:0.75rem 0.75rem 0px 0.75rem;
}
#doublePub .GenderSelection .genders img{
   height:1.75rem;
   width:2.2rem;
}
#doublePub .GenderSelection p:nth-child(1){
    font-size:0.8rem;
    color:#29a193;
    padding:0.75rem 0px 0px 0.75rem;
}
#doublePub .GenderSelection .submit{
    width:100%;
    text-align:center;
    height:3rem;
    line-height:3rem;
    margin-top:1rem;
    border-radius:13px;
    background:#29a193;
    color:#fff;
}
</style>